#include <stdio.h>
int main()
{
	int val;
	printf("请输入一个正整数： ");
	scanf("%d",&val);
__asm__ __volatile__(
		"MOV x1,#0\n"
		"add:\n"
		"ADD x1,x1,x0\n"
		"SUB x0,x0,#1\n"
		"CMP x0,#0\n"
		"BNE add\n"
		"MOV x0,x1\n"
		:"=r"(val)
		:"0"(val)
		:
		);
	printf("sum is %d \n",val);
	return  0;
}
